import requests

# 设置基础 URL
base_url = "https://s3.ananas.chaoxing.com/sv-w8/doc/36/16/d6/7b30fa235e763257c3a2d8cf26803a5d/thumb/"

# 下载图片的范围
start_image = 4
end_image = 23

for i in range(start_image, end_image + 1):
    # 构建图片 URL
    image_url = f"{base_url}{i}.png"

    # 发起请求下载图片
    response = requests.get(image_url)

    if response.status_code == 200:
        # 成功响应，写入文件
        with open(f"{i}.png", 'wb') as f:
            f.write(response.content)
        print(f"Downloaded {i}.png")
    else:
        print(f"Failed to download {i}.png: {response.status_code}")